package com.ymttest.database.sqlwapper.shenqisettlement;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.shenqisettlement.TeWithdrawFeeConfig;

public class TeWithdrawFeeConfigWrapper {
	
	SqlManager manager;

	public TeWithdrawFeeConfigWrapper() {
		manager = new SqlManager("shenqisettlement");
	}

	@SuppressWarnings("unchecked")
	public TeWithdrawFeeConfig selectByPrimaryKey(long id) {

		TeWithdrawFeeConfig teWithdrawFeeConfig = new TeWithdrawFeeConfig();
		List<TeWithdrawFeeConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.TeWithdrawFeeConfigMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			teWithdrawFeeConfig = result.get(0);
		}

		return teWithdrawFeeConfig;
	}
	
	@SuppressWarnings("unchecked")
	public TeWithdrawFeeConfig selectByCountry(String country) {

		TeWithdrawFeeConfig teWithdrawFeeConfig = new TeWithdrawFeeConfig();
		List<TeWithdrawFeeConfig> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.TeWithdrawFeeConfigMapper.selectByCountry",
						country);
		manager.commit();

		if (result.size() > 0) {
			teWithdrawFeeConfig = result.get(0);
		}

		return teWithdrawFeeConfig;
	}
	
	public static void main(String[] args) {
		
		TeWithdrawFeeConfigWrapper wrapper = new TeWithdrawFeeConfigWrapper();
		
		System.out.println(wrapper.selectByCountry("CHN").getCurrency());
	}
}
